package com.example.tests;

public class ContactData implements Comparable<ContactData> {
	private String contact_id;
	private String firstname;
	private String lastname;
	private String address;
	private String homephone;
	private String mobilephone;
	private String workphone;
	private String firstemail;
	private String secondemail;
	private String birthday;
	private String birthmonth;
	private String birthyear;
	private String group;
	private String secondaddress;
	private String secondphone;

	public ContactData() {
	}

	@Override
	public String toString() {
		return "ContactData [firstname=" + firstname + ", lastname="
				+ lastname + ", homephone=" + homephone
				+ ", firstemail=" + firstemail + "]";
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((firstemail == null) ? 0 : firstemail.hashCode());
		result = prime * result
				+ ((firstname == null) ? 0 : firstname.hashCode());
		result = prime * result
				+ ((homephone == null) ? 0 : homephone.hashCode());
		result = prime * result
				+ ((lastname == null) ? 0 : lastname.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (firstemail == null) {
			if (other.firstemail != null)
				return false;
		} else if (!firstemail.equals(other.firstemail))
			return false;
		if (firstname == null) {
			if (other.firstname != null)
				return false;
		} else if (!firstname.equals(other.firstname))
			return false;
		if (homephone == null) {
			if (other.homephone != null)
				return false;
		} else if (!homephone.equals(other.homephone))
			return false;
		if (lastname == null) {
			if (other.lastname != null)
				return false;
		} else if (!lastname.equals(other.lastname))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other) {
		return this.firstname.toLowerCase().compareTo(other.firstname.toLowerCase());
	}

	public ContactData withFirstname(String firstname) {
		this.firstname = firstname;
		return this;
	}

	public ContactData withLastname(String lastname) {
		this.lastname = lastname;
		return this;
	}

	public ContactData withFirstemail(String firstemail) {
		this.firstemail = firstemail;
		return this;
	}

	public ContactData withHomephone(String homephone) {
		this.homephone = homephone;
		return this;
	}

	public ContactData withAddress(String address) {
		this.address = address;
		return this;
	}

	public ContactData withBirthday(String birthday) {
		this.birthday = birthday;
		return this;
	}

	public ContactData withBirthmonth(String birthmonth) {
		this.birthmonth = birthmonth;
		return this;
	}

	public ContactData withBirthyear(String birthyear) {
		this.birthyear = birthyear;
		return this;
	}

	// [start getters] ---------------------------------
	public String getContact_id() {
		return contact_id;
	}
	
	public String getFirstname() {
		return firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public String getAddress() {
		return address;
	}

	public String getHomephone() {
		return homephone;
	}

	public String getMobilephone() {
		return mobilephone;
	}

	public String getWorkphone() {
		return workphone;
	}

	public String getFirstemail() {
		return firstemail;
	}

	public String getSecondemail() {
		return secondemail;
	}

	public String getBirthday() {
		return birthday;
	}

	public String getBirthmonth() {
		return birthmonth;
	}

	public String getBirthyear() {
		return birthyear;
	}
/*
	public String getGroup() {
		return group;
	}
*/
	public String getSecondaddress() {
		return secondaddress;
	}

	public String getSecondphone() {
		return secondphone;
	}
	// [end getters] -------------------------------------
	
	// [start Setters] -----------------------------------
	public void setContact_Id (String contact_id){
		this.contact_id = contact_id;
	}
	
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setHomephone(String homephone) {
		this.homephone = homephone;
	}

	public void setMobilephone(String mobilephone) {
		this.mobilephone = mobilephone;
	}

	public void setWorkphone(String workphone) {
		this.workphone = workphone;
	}

	public void setFirstemail(String firstemail) {
		this.firstemail = firstemail;
	}

	public void setSecondemail(String secondemail) {
		this.secondemail = secondemail;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public void setBirthmonth(String birthmonth) {
		this.birthmonth = birthmonth;
	}

	public void setBirthyear(String birthyear) {
		this.birthyear = birthyear;
	}
/*
	public void setGroup(String group) {
		this.group = group;
	}
*/
	public void setSecondaddress(String secondaddress) {
		this.secondaddress = secondaddress;
	}

	public void setSecondphone(String secondphone) {
		this.secondphone = secondphone;
	}
	//[end Setters] ---------------------------------------------------------------

}